package chapter11;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-23 上午11:08
 */
public class InputTest2 {


    public static void main(String[] args) {
        boolean flag = true;

        try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
            while (flag) {
                System.out.println("please input data");
                String buf = reader.readLine();
                if ("q".equals(buf)) {
                    System.out.println("Quit...");
                    flag = false;
                } else {
                    System.out.println("input data:" + buf);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}